package com.kuang.lesson01

import java.net.InetAddress
import java.net.InetSocketAddress

fun main() {
    println(InetSocketAddress("localhost", 8080)) //localhost/127.0.0.1:8080
    println(InetSocketAddress("127.0.0.1", 8080)) ///127.0.0.1:8080
    println("------------------")

    InetSocketAddress(InetAddress.getLocalHost(),8080).apply {
        println(address)
        println(hostName)   //域名 hosts文件
        println(hostString)
        println(port)       //端口号
        /*
        USER-VFGNDPVELL/192.168.0.16
        USER-VFGNDPVELL
        USER-VFGNDPVELL
        8080
         */
    }



}